package com.rays.sysmech.utils;

import java.io.File;

import javax.swing.ImageIcon;

public class Utils {
	
	/** Returns an ImageIcon, or null if the path was invalid. */
	public static ImageIcon createImageIcon(String path) {
		if(null != path)
		{
			return new ImageIcon(path);
		}
		
		return null;
	}
	
	public static String getFileExtension(File iFile)
	{
		String ext = "";
		if(null != iFile)
		{
			String fileName = iFile.getName();
			int dotIndx = fileName.lastIndexOf('.');
			ext = fileName.substring(dotIndx);
		}
		return ext;
	}

}
